package com.sven.hello;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.cloud.netflix.zuul.filters.ZuulProperties;
import org.springframework.context.annotation.Bean;

@EnableZuulProxy
@SpringBootApplication
public class ApiGatewayDynamicApplication {

	public static void main(String[] args) {
		SpringApplication.run(ApiGatewayDynamicApplication.class, args);
	}

	//将zuul的配置内容动态化
	@RefreshScope
	@Bean
	public ZuulProperties zuulProperties() {
		return new ZuulProperties();
	}

}
